<!DOCTYPE html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>MDV + ShadowDOM Polyfill Integration Tests</title>
  <link rel="stylesheet" href="../../../tools/test/mocha/mocha.css">
  <script src="../../../webcomponentsjs/webcomponents.js" shadow="polyfill"></script>
  <script>
    var parserHasNativeTemplate = function() {
      var div = document.createElement('div');
      div.innerHTML = '<table><template>';
      return div.firstChild.firstChild &&
             div.firstChild.firstChild.tagName == 'TEMPLATE';
    }();

    var forceCollectObservers = true;
    var exposeGetExpression = true;
  </script>
  <!-- data binding libraries -->
  <!-- NOTE: avoid imports since the SD polyfill is not compatible with 
  native HTMLImports -->
  <script src="../../../polymer-expressions/third_party/esprima/esprima.js"></script>
  <script src="../../../polymer-expressions/src/polymer-expressions.js"></script>
  <script src="../../../observe-js/src/observe.js"></script>
  <script src="../../../NodeBind/src/NodeBind.js"></script>
  <script src="../../../TemplateBinding/src/TemplateBinding.js"></script>
  <script src="../../src/system/microtask.js"></script>
  <script src="../../src/system/flush.js"></script>
  <script src="../../../tools/test/mocha/mocha.js"></script>
  <script src="../../../tools/test/chai/chai.js"></script>
  <script src="../../../tools/test/htmltest.js"></script>
  <script>

    mocha.setup({
      ignoreLeaks: true,
      ui: 'tdd'
    });

    var assert = chai.assert;

  </script>
  <script src="mdv-tests/polymer-expressions-tests.js"></script>
  <script src="mdv-tests/template-binding-tests.js"></script>
</head>
<body>
  <div id="mocha"></div>
  <script>
    // mocha stomps window.onerror, save for failure case
    var htmlsuite_fail = window.onerror;
    var runner = mocha.run();
    runner.on('fail', function(test, err) {
      htmlsuite_fail(err.toString());
    });
    runner.on('end', function() {
      runner.failures || done();
    });
  </script>
</body>
</html>
